package gui.typeEditors;

import java.awt.event.ActionListener;
import java.awt.event.FocusListener;

public class ShortEditor extends NumberEditor<Short> implements ActionListener, FocusListener
{
	private static final long serialVersionUID = 6195335893738468965L;
	
	public ShortEditor(short initialValue)
	{
		super(initialValue, (short)1, DEFAULT_COLUMNS, true);
	}
	
	@Override
	public Short getValue()
	{
		return (short)value;
	}

	@Override
	protected Short div(Short value, Short divisor)
	{
		return (short) (value/divisor);
	}

	@Override
	protected Short mul(Short value, Short factor)
	{
		return (short) (value*factor);
	}

	@Override
	protected Short parse(String text)
	{
		return Short.parseShort(text);
	}
	
}
